steam_ugc_get_item_update_info

语法:

steam_ugc_get_item_update_info(published_file_id, info_map);


参数 描述
published_file_id The unique file ID for the UGC to be checked.
info_map A (previously created) DS map index.


返回: 布尔值


描述

This function can be used to retrieve information about the current download state for the given file ID. You give the item ID and supply the index to an empty DS map which will then be populated with the following key/value pairs if the item exists:

  1. "needs_update" - Will return true or false depending on whether the item needs an update or not.

  2. "is_downloading" - Will return true or false depending on whether the item is currently downloading or not.

  3. "bytes_downloaded" - The number of bytes that has been downloaded.

  4. "bytes_total" - The total size (number of bytes) required for the item on disk.

If the item exists then the function will return true and populate the map, otherwise it will return false and the map will remain empty.


例如:

var info_map = ds_map_create();
var info = steam_ugc_get_item_update_info(global.fileID, info_map);
if info
   {
   draw_text(32, 15, "needs_update: " + string(info_map[?"needs_update"]));
   draw_text(32, 30, "is_downloading: " + string(info_map[?"is_downloading"]));
   draw_text(32, 45, "bytes_downloaded: " + string(info_map[?"bytes_downloaded"]));
   draw_text(32, 60, "bytes_total: " + string(info_map[?"bytes_total"]));
   }

The above code will query the download status of the item indexed in the global variable "fileID", using a ds_map to store the information.